﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Xfm.Core.Auth;
using Xfm.Simple.Models;

namespace Xfm.Simple.Controllers
{
    public class HomeController : Controller
    {
        private readonly ILogger _logger;
        Microsoft.Extensions.Configuration.IConfiguration _configuration;
        IXfmService _xfService;
        //UserManager _userManager;
        public HomeController(ILogger<HomeController> logger, Microsoft.Extensions.Configuration.IConfiguration configuration, IXfmService xfService)
        {
            _logger = logger;
            _configuration = configuration;
            _xfService = xfService;
            //_userManager = userManager;
        }

        public IActionResult Index()
        {
            var ops= _xfService.GetOptions();
            _logger.LogInformation(new EventId(1001), "测试Nlog");
            _logger.LogInformation("测试Nlog222");
            //_userManager.Login("", "");
            return View();
        }

        public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}
